#!/usr/bin/env bash
base_path=~/docker/loki/loki
script_pwd=$(dirname "$0")
container_name=loki-loki

rm -rf $base_path/config 
mkdir -p $base_path/{config,data}
cp -r $script_pwd/loki.yaml $base_path/config/.

docker network create loki

docker rm -f $container_name

docker run -d \
--name $container_name \
-v $base_path/config/loki.yaml:/mnt/config/loki.yaml \
-v $base_path/data:/tmp/loki \
-p 3100:3100 \
--network loki \
grafana/loki:3.3.1 \
-config.file=/mnt/config/loki.yaml \
-target=all
